<template>
	<view class="home">
		<view class="row">
			<view v-for="item in users" :key="item._id">
				姓名：{{item.name}}-年龄：{{item.age}}-邮箱：{{item.mail}}
			</view>
			<button @click="button1">更新数据库</button>
			<button @click="button2">删除数据库</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				"users":[]
			}
		},
		onLoad() {
			this.button1()	
		},
		methods: {
			button1(){
				uniCloud.callFunction({
					name:"funcdbUpdate",
					data:{
						
					}
				}).then(res=>{
					this.users = res.result.data;
					console.log(res);
				})
			},
			button2(){
				uniCloud.callFunction({
					name:"funcdbRemove",
					data:{
						
					}
				}).then(res=>{
					console.log(res);
				})
			}
		}
	}
</script>

<style>

</style>
